package com.yuyi.kotlindemo

import android.annotation.SuppressLint
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import android.view.LayoutInflater
import android.view.View
import com.yuyi.kotlindemo.databinding.ActivityMainBinding
import com.yuyi.kotlindemo.login.LoginActivity
import kotlinx.android.synthetic.main.activity_main.*
import kotlinx.coroutines.*

class MainActivity : AppCompatActivity() {
    private val s = "MAIN_ACTIVITY"
    private var bind : ActivityMainBinding? = null

    @SuppressLint("InflateParams")
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        bind = ActivityMainBinding.inflate(LayoutInflater.from(this))
        setContentView(bind!!.root)

        bind!!.loginBtn.setOnClickListener(View.OnClickListener {
            startActivity(Intent(this, LoginActivity :: class.java))
        })
    }


    private fun test() = runBlocking {
        repeat(8){
            Log.e(s, "携程执行$it 线程id: ${Thread.currentThread().id}")
            delay(1000)
        }
    }
}